#include <iostream>
using namespace std;
int n;
int a[2010] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
void func(int t) {
    int ans = 0;
    int x = t;
    while(x) {
        int temp = x % 10;
        ans += a[temp];
        x /= 10;
    }
    a[t] = ans;
}
int main() {
    cin >> n;
    n -= 4;
    int cnt = 0;
    for(int i = 10; i < 2000; i++) {
        func(i);
    }
    for(int i = 0; i < 1000; i++) {
        for(int j = 0; j < 1000; j++) {
            if(a[i + j] + a[i] + a[j] == n){
                cnt++;
            }
        }
    }
    cout << cnt;
    return 0;
}